package com.example.chat_websocket.controller;

import com.example.chat_websocket.pojo.User;
import com.example.chat_websocket.service.LoginService;
//import com.example.chat_websocket.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @version 1.0
 * @Author 张云飞
 * @Date 2021/10/30 0030 9:55
 * @注释
 */
@Controller
public class RegisterController {

    @Autowired
    private LoginService loginService;
    @RequestMapping("register")
//    @ResponseBody
    public String register(User user){
        String s=loginService.register(user);
        if (s.equals("1")){
            return "login.html";
        }else if(s.equals("2")){
            return "login.html";
        }
        return "show.html";
    }
}
